//package zz.demo.springCloud.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
//import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
//
//
///**
// * Created by zhangzheng on 2017-6-20.
// */
//@Configuration
//@EnableRedisHttpSession(redisNamespace = "user",maxInactiveIntervalInSeconds = 10 * 60)
//public class SpringSessionConfig {
//
////    @Bean
////    public RedisTemplate sessionRedisTemplate() throws Exception{
////        RedisTemplate template = new RedisTemplate();
////        template.setKeySerializer(new StringRedisSerializer());
////        template.setHashKeySerializer(new StringRedisSerializer());
////        template.setValueSerializer(new StringRedisSerializer());
////        template.setHashValueSerializer(new StringRedisSerializer());
////        template.setConnectionFactory(this.connectionFactory());
////        template.afterPropertiesSet();
////        return template;
////    }
//
//    @Bean
//    public JedisConnectionFactory connectionFactory() throws Exception{
//        JedisConnectionFactory connectionFactory = new JedisConnectionFactory();
//        connectionFactory.setHostName("localhost");
//        connectionFactory.setPort(6379);
//        connectionFactory.setPassword("123456");
//        return connectionFactory;
//    }
//
////    @Bean
////    public RedisSerializer<Object> springSessionDefaultRedisSerializer(){
////        return new CustomRedisSerializer(RedisTemplate.class.getClassLoader());
////    }
//
//
//}
